<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('表格传值给父页面')" />
</head>
<body>
<div class="col-sm-12 select-table table-striped">
    <table id="bootstrap-table"></table>
</div>
<script th:inline="javascript">
    // var forceFlag = [[${@permission.hasPermi('monitor:online:forceLogout')}]];
    var prefix = ctx + "transport/isoUnit";

    $(function() {
        var options = {
            url: prefix + "/list",
            exportUrl: prefix + "/export",
            sortName: "lastAccessTime",
            sortOrder: "desc",
            showExport: true,
            escape: true,
            columns: [{
                checkbox: true
            },
                {
                    title: "序号",
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                },
                {
                    field: 'unitCode',
                    title: '运输单位类型',
                    sortable: true
                },
                {
                    field: 'description',
                    title: '描述',
                    sortable: true
                },
                {
                    field: 'presentFactor',
                    title: '因素',
                    sortable: true
                },
                {
                    field: 'baseUnit',
                    title: '基本单元',
                    sortable: true
                },
                {
                    field: 'unitType',
                    title: '类型',
                    sortable: true
                }
            ]
        };
        $.table.init(options);
    });

    // // 单条强退
    // function forceLogout(sessionId) {
    //     $.modal.confirm("确定要强制选中用户下线吗？", function() {
    //         var data = { "ids": sessionId };
    //         $.operate.post(prefix + "/batchForceLogout", data);
    //     })
    // }
    //
    // // 批量强退
    // function batchForceLogout() {
    //     var rows = $.table.selectColumns("sessionId");
    //     if (rows.length == 0) {
    //         $.modal.alertWarning("请选择要强退的用户");
    //         return;
    //     }
    //     $.modal.confirm("确认要强退选中的" + rows.length + "条数据吗?", function() {
    //         var url = prefix + "/batchForceLogout";
    //         var data = { "ids": rows.join() };
    //         $.operate.post(url, data);
    //     });
    // }
</script>
</body>
</html>